"""
家 VO
"""

from models import (
    VOBase,
    VOPage,
)
from my_typing import *
from utils.data_utils.special import ObjectIdStr
from utils.mock_utils import Demo
from utils.validator_utils.pydantic_validator.field import CharField


class FamilyHomeListVO(VOBase):
    """ 家庭 | 家 | 列表 | VO """

    home_id: ObjectIdStr = CharField(..., title="家 ID（ObjectId 字符串）", examples=[Demo.id])

    alias: StrOrNone = CharField(None, title="别名", min_length=3, max_length=32)
    name: str = CharField(..., title="名称", min_length=1, max_length=32)
    update_time: str = CharField(..., title="更新时间", min_length=19, max_length=19, examples=[Demo.dt_str])


class FamilyHomeDetailVO(FamilyHomeListVO):
    """ 家庭 | 家 | 详情 | VO """

    building: StrOrNone = CharField(None, title="楼幢楼层信息", max_length=32)
    community_name: StrOrNone = CharField(None, title="小区名称", max_length=32)
    create_time: str = CharField(..., title="创建时间", min_length=19, max_length=19, examples=[Demo.date_str])
    description: StrOrNone = CharField(None, title="描述", max_length=256)
    region_name: StrOrNone = CharField(None, title="行政区划名称")


class FamilyHomeListPage(VOPage[FamilyHomeListVO]):
    """ 家庭 | 家 | 列表 | 分页 """
